<?php

namespace App\Http\Controllers\Api;

use App\Services\VerificationCodeService;
use App\Http\Requests\Api\CaptchaRequest;
class VerificationCodesController extends Controller
{
    //
    public function store(CaptchaRequest $request,VerificationCodeService $verificationCodeService){
        $phone = $request->phone;
        //发送手机短信验证码，并返回含有手机号和验证码value的随机key
        $return = $verificationCodeService->createPhoneCode($phone);
        return response()->json($return)->setStatusCode(201);
    }
}
